package com.zengge.zbc.po;

import com.zengge.zbc.utils.SnowFlakeIdGenerator;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Index;
import javax.persistence.Table;

@Table(name = "room_info", indexes = {
        @Index(name = "idx_user_obj_id", columnList = "user_obj_id", unique = false)
})
public class RoomInfo {

    @Id
    @Column(name = "object_id")
    private long objectId;

    @Column(name = "room_name")
    private String roomName;

    @Column(name = "user_obj_id")
    private long userObjId;

    @Column(name = "address")
    private int address;

    public RoomInfo() {
    }

    public RoomInfo(String roomName, long userObjId,int address) {
        this.objectId = SnowFlakeIdGenerator.next();
        this.roomName = roomName;
        this.userObjId = userObjId;
        this.address = address;
    }

    public long getObjectId() {
        return objectId;
    }

    public void setObjectId(long objectId) {
        this.objectId = objectId;
    }

    public String getRoomName() {
        return roomName;
    }

    public void setRoomName(String roomName) {
        this.roomName = roomName;
    }

    public long getUserObjId() {
        return userObjId;
    }

    public void setUserObjId(long userObjId) {
        this.userObjId = userObjId;
    }

    public int getAddress() {
        return address;
    }

    public void setAddress(int address) {
        this.address = address;
    }
}
